package com.lx.service;

import com.lx.IRPCService.IHelloB;
import com.lx.IRPCService.IHelloC;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@DubboService
@RequestMapping("/helloB")
public class HelloB implements IHelloB {

    @DubboReference
    IHelloC iHelloC;

    @GetMapping("/sayHello")
    @Override
    public String sayHello(String name) {
        System.out.println("helloB "+ name);
        iHelloC.sayHello("我是B，我调用了C");
        return "helloB "+ name;
    }
}
